package demo01;

/**
 * @author mubei
 * @date 2021/11/19
 * @description 实现Runnable接口  重写run方法   执行线程需要丢入runnable接口实现类 调用start()
 */
public class TestRunnable implements  Runnable {
    @Override
    public void run() {
        for (int i = 0; i < 200; i++) {
            System.out.println("使用runnable");
        }
    }

    public static void main(String[] args) {
        TestRunnable runnable = new TestRunnable();
        Thread thread = new Thread(runnable);

        thread.start();

        for (int i = 0; i < 1000; i++) {
            System.out.println("main线程");
        }
    }
}
